]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
gdm/util: Start fingerprint verification once it's available
authorMarco Trevisan (Treviño) <mail@3v1n0.net>
Tue, 12 Apr 2022 14:38:40 +0000 (16:38 +0200)
committerMarco Trevisan (Treviño) <mail@3v1n0.net>
Wed, 28 Feb 2024 21:10:44 +0000 (22:10 +0100)
If fingerprint service is not replying fast enough to our async request,
authentication is started but the fingerprint service is never started.

So, in case the fingerprint type information is received after that the
authentication has been started, let's start the service.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2267>

js/gdm/util.js

index 6731200f66c1e0a956405369e3c2fe18d416aa38..24593f6b5c312cf377e685fd2241ec66612c0369 100644 (file)
@@ -366,6 +366,13 @@ export class ShellUserVerifier extends Signals.EventEmitter {
             ? FingerprintReaderType.SWIPE
             : FingerprintReaderType.PRESS;
         this._updateDefaultService();
+
+        if (this._userVerifier &&
+            !this._activeServices.has(FINGERPRINT_SERVICE_NAME)) {
+            if (!this._hold?.isAcquired())
+                this._hold = new Batch.Hold();
+            await this._maybeStartFingerprintVerification();
+        }
     }
 
     _onCredentialManagerAuthenticated(credentialManager, _token) {
@@ -617,11 +624,14 @@ export class ShellUserVerifier extends Signals.EventEmitter {
 
     _beginVerification() {
         this._startService(this._getForegroundService());
+        this._maybeStartFingerprintVerification().catch(logError);
+    }
 
+    async _maybeStartFingerprintVerification() {
         if (this._userName &&
             this._fingerprintReaderType !== FingerprintReaderType.NONE &&
             !this.serviceIsForeground(FINGERPRINT_SERVICE_NAME))
-            this._startService(FINGERPRINT_SERVICE_NAME);
+            await this._startService(FINGERPRINT_SERVICE_NAME);
     }
 
     _onChoiceListQuery(client, serviceName, promptMessage, list) {